<div id="loginForm">
<?php
echo($javascript->link("preview_image.js"));

echo $form->create('User', array('action'=>'register','enctype' => 'multipart/form-data'));
?>

<?php
    echo $form->input('email_addr', array('after'=>$form->error('username_unique', 'Email existed')));
    echo $this->Form->input('passwd',array( 'label' => 'Password', 'after'=>$form->error('pass_wrong', 'Password does not match.')));
    echo $this->Form->input('password',array( 'label' => 'Repeat password', 'after'=>$form->error('empty_pass', 'You must retype your password.')));
    echo $this->Form->input('image',array('type'=>'file','id'=>'picField','onchange'=>'preview(this)','label'=>'Profile image'));
    echo '<center>';
    echo $this->Html->image('default_user.jpg', array('alt' => 'Preview','id'=>'previewField'));
    echo '<br/><br/>';
    echo '</center>';
    echo $this->Form->input('first_name',array( 'label' => 'First name'));
    echo $this->Form->input('last_name',array( 'label' => 'Last name'));
    echo $this->Form->input('phone',array( 'label' => 'Phone number'));
    echo $this->Form->input('addr1',array('label'=>'Primary Adress'));
    echo $this->Form->input('addr2',array('label'=>'Secondary Adress'));
    echo $this->Form->input('city',array('label'=>'City'));
    echo $this->Form->input('state',array('label'=>'State'));
    echo $this->Form->input('postal',array('label'=>'Postal'));

?>

<?php
echo $form->end('Register');
?>
</div>